//related to badgeround.ui
var root = ui("$");
var nf = sm("do_Notification");
var conbgbox = ui("do_ALayout_1");
conbgbox.on("touch","",300,function(){
	bgmask.animate(animMaskHide,function(){
		bgmask.visible = false;
	});
	paneler.animate(animPanelHide);
});
//遮罩显示
var animMaskShow = mm("do_Animator");
var propsMS = {bgColor:"00000044"};
animMaskShow.append(320,propsMS,"EaseOut");
//面板显示
var animPanelShow = mm("do_Animator");
var propsPS = {x:440,alpha:1};
animPanelShow.append(320,propsPS,"EaseOut");
//遮罩隐藏
var animMaskHide = mm("do_Animator");
var propsMH = {bgColor:"00000000"};
animMaskHide.append(320,propsMH,"EaseOut");
//面板隐藏
var animPanelHide = mm("do_Animator");
var propsPH = {x:640,alpha:0.8};
animPanelHide.append(320,propsPH,"EaseOut");

var page = sm("do_Page");
var paneler = ui("do_ALayout_1");
var grid_view1 = ui("grid_view");
//自定义事件---打开
root.on("popmenuSJ",function(data){
	bgmask.visible = true;
	bgmask.animate(animMaskShow);
	paneler.animate(animPanelShow);

	var listdata = mm("do_ListData");
	listdata.addData(data); // 给ListData添加数据
	grid_view1.bindItems(listdata);
	grid_view1.refreshItems(); // 刷新ListView 行数据;
});
//遮罩事件
var bgmask = ui("maskbg");
bgmask.on("touch","",300,function(){
	bgmask.animate(animMaskHide,function(){
		bgmask.visible = false;
	});
	paneler.animate(animPanelHide);
});
//订阅GridView的touch点击事件
grid_view1.on("touch", function(data) {
	root.fire("popmenuItem",data);
})
//订阅GridView的touch点击事件
root.on("popmenuClose",function(data){
	bgmask.animate(animMaskHide,function(){
		bgmask.visible = false;
	});
	paneler.animate(animPanelHide);
})